package com.jie.entity;



import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.*;

import java.io.Serializable;

/**
 * <p>
 * 论坛文章表
 * </p>
 *
 * @author jie
 * @since 2024-05-29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Builder
@TableName("article")
public class Article implements Serializable {

    private static final long serialVersionUID=1L;
    /**
     * 自增id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 发表用户
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 文章内容
     */
    @TableField("article_content")
    private String articleContent;

    /**
     * 文章标题
     */
    @TableField("article_title")
    private String articleTitle;

    /**
     * 文章缩略图
     */
    @TableField("article_cover")
    private String articleCover;

    /**
     * 文章点击数量
     */
    @TableField("article_click_count")
    private Integer articleClickCount;

    /**
     * 文章评论数量
     */
    @TableField("comment_count")
    private Integer commentCount;

    /**
     * 文章点赞数量
     */
    @TableField("liked_count")
    private Integer likedCount;
    /**
     * 文章转发数量
     */
    @TableField("reposted_count")
    private Integer repostedCount;

    /**
     *
     * 分类id
     */
    @TableField("category_id")
    private Integer categoryId;

    /**
     * 是否推荐
     */
    @TableField("is_recommend")
    private Integer isRecommend;

    /**
     * 是否发布
     */
    @TableField("status")
    private Integer status;

    /**
     * 审核通过（0：未审核，1：成功，2：审核未通过）
     */
    @TableField("audit_status")
    private Integer auditStatus;
    /**
     * 是否删除
     */
    @TableField("is_delete")
    private Integer isDelete;

    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
